package demo1;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2023-11-22
 * Time: 16:34
 */
class Student{
    private String name;
    private int age;

    public Student(String name,int age){
        this.name = name;
        this.age = age;
        System.out.println("2个参数的构造方法");
    }
    public void print(){
        System.out.println(this.name+"的年龄为："+this.age);
    }
}
public class Test1 {
    public static void main(String[] args) {
        Student student1 = new Student("zhangsan",18);
        student1.print();
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        System.out.println(a);
    }
}
